//
//  YHInputTextField.h
//  AddressBookCloud
//
//  Created by 林宁宁 on 2020/5/10.
//  Copyright © 2020 林宁宁. All rights reserved.
//

#import "YHBaseView.h"
#import "YHInputFormatProtocol.h"

NS_ASSUME_NONNULL_BEGIN


@interface YHInputTextField : UITextField


@property (copy, nonatomic) NSString * yh_placeholder;

@property (retain, nonatomic) id<YHInputFormatProtocol>format;

/// 不可用 输入的内容不符合要求的时候 状态
@property (assign, nonatomic, readonly) BOOL unUsable;
/// 不显示复制.粘贴
@property(nonatomic, assign) BOOL canPerform;

/// 快要开始编辑回调
@property (copy, nonatomic) BOOL(^beginEditBlock)(YHInputTextField * passTextField);
/// 内容发生变化
@property (copy, nonatomic) void(^didChangeBlock)(YHInputTextField * passTextField);

@property (copy, nonatomic) void(^endEditBlock)(YHInputTextField * passTextField);

@property (retain, nonatomic) UIView * leftContentView;
@property (retain, nonatomic) UIView * rightContentView;

- (void)addLeftViewShowWidth:(CGFloat)width image:(UIImage *)image imgSize:(CGSize)imgSize withImageViewConfig:(void (^)(UIImageView *imageView))blockImageView;

- (void)addLeftViewShowWidth:(CGFloat)width image:(UIImage *)image imgSize:(CGSize)imgSize;
- (void)addRightViewShowWidth:(CGFloat)width image:(UIImage *)image imgSize:(CGSize)imgSize;
- (void)addRightViewShowWidth:(CGFloat)width image:(UIImage *)image imgSize:(CGSize)imgSize withAddClick:(void (^)(void))block;



- (void)addLeftViewShowWidth:(CGFloat)width title:(NSString *)title;
- (void)addLeftViewShowWidth:(CGFloat)width title:(NSString *)title withFont:(CGFloat)font;
- (void)addRightViewShowWidth:(CGFloat)width title:(NSString *)title;

- (void)addViewShowWidth:(CGFloat)width title:(NSString *)title image:(UIImage *)image left:(BOOL)isLeft;

- (void)addHeadViewShowWidth:(CGFloat)width attributeTitle:(NSAttributedString *)attribute isLeft:(BOOL)isLeft;

- (void)addHeadViewShowWidth:(CGFloat)width customView:(UIView *)customView isLeft:(BOOL)isLeft;


- (void)cleanLeftView;
- (void)cleanRightView;

@end

NS_ASSUME_NONNULL_END
